package com.example.lambda;

import com.qcloud.cos.model.transform.SelectObjectContentEventUnmarshaller;
import org.junit.jupiter.api.Test;

import java.util.function.BiConsumer;

public class TestLamdba4 {

    @Test
    public void test1(){
        int s = fun1(num -> num*2,12);
        MyFunction2 myFunction2 = (MyFunction2<String, String>) (t1, t2) -> t1+t2;

        String ss = fun2(( t1, t2) -> t1+t2,"xrb");
        fun3((a,b)->{
            System.out.println(a+b);
        },"xrb");
        //System.out.println(s);
        //System.out.println(ss);
    }

    private int fun1(MyFun myFun,int value){
        return myFun.getValue(value);
    }

    private String fun2(MyFunction2<String,String> myFunction2,String s){

        return myFunction2.getValue(s,s)+s;
    }

    private void fun3(BiConsumer<String,String> biConsumer,String value){
        biConsumer.accept(value,value);
    }
}
